package NeuronNetworkLibrary;

/**
 * This class represents the methods used for calculating activation function.
 * @author Zbyszko
 */
public class ActivationFunction {
    
    /**
     * Represents linear function: f(x) = x
     * @param calculatedOutput The result obtained from calculating weighted sum.
     * @return 
     */
    public static double linearFunction(double calculatedOutput){

        return calculatedOutput;
    }
    
    /**
     * Represents the sinusoidal function: f(x) = sin(x)
     * @param calculatedOutput The result obtained from calculating weighted sum.
     * @return 
     */
    public static double sinusoidalFunction(double calculatedOutput){

        return Math.sin(calculatedOutput);
    }
    
    /**
     * Represents the sigmoidal function: f(x) = 1/(1+e^-ßx)
     * @param calculatedOutput The result obtained from calculating weighted sum.
     * @return 
     */
    public static double sigmoidalFunction(double calculatedOutput){
        final double beta = -0.5;
        return 1/(1 + Math.exp(beta*calculatedOutput));
    }
        
}
